<? include "./mobile/view/header.inc.htm"; ?>

<div style="width: 300px; margin: auto;">
	<form method="POST" id="mod_delete_form" action="pc/mod-delete-<?=$tids?>.htm" class="form">
		<p>选中：<b><?=count($tidarr)?></b> 篇</p>
		<p>
			操作：<label><input type="radio" value="0" checked>删除</label>
		</p>
		<p class="center">
			<button type="submit" loading-text="正在提交..." class="blue big">确定</button>
		</p>
	</form>
</div>

<? include "./mobile/view/footer.inc.htm"; ?>

<script>

// 防止 ajax dialog 加载时污染全局变量
var jdialog = typeof arguments == 'undefined' ? null : arguments[0]; // 接受第一个参数
var deletetids = '<?=$tids?>'.split('_');
$(function() {
	var jform = $('#mod_delete_form');
	var jsubmit = jform.find('button[type="submit"]');
	//jform.off('submit').on('submit', function() {
	jsubmit.off('click').on('click', function() {
		var postdata = jform.serialize();
		jsubmit.button('loading');
		$.xpost(jform.attr('action'), postdata, function(code, message) {
			if(code == 0) {
				jsubmit.button(message);
				setTimeout(function() {
					var arr = parse_url_param(window.location.toString());
					if(arr[0] == 'thread' && $.inArray(tid+'', deletetids) != -1) {
						window.location = 'forum-'+fid+'.htm';
					} else {
						window.location.reload();
					}
				}, 500);
			} else {
				$.alert(message);
				jsubmit.button('reset');
			}
		});
		return false;
	});
});
</script>